package com.ruihu.api.module.business.task.controller;

import com.ruihu.admin.common.anno.NoValidPrivilege;
import com.ruihu.admin.common.anno.OperateLog;
import com.ruihu.admin.common.controller.BaseController;
import com.ruihu.admin.common.domain.ResponseDTO;
import com.ruihu.admin.constant.ElectricConfigTypeEnum;
import com.ruihu.admin.constant.SwaggerTagConst;
import com.ruihu.admin.module.business.electric.config.domain.vo.ElectricTypeVO;
import com.ruihu.admin.module.business.electric.config.service.ElectricConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("electricConfigApiControoler")
@Api(tags = {SwaggerTagConst.Mobile.SUB_TASK_API})
@OperateLog
public class ElectricConfigController extends BaseController {

    @Autowired
    private ElectricConfigService electricConfigService;

    @ApiOperation(value = "查询电芯类型",notes = "@author Tony")
    @GetMapping("/api/electricConfig/queryCellType")
    @NoValidPrivilege
    public ResponseDTO<List<ElectricTypeVO>> queryCellType() {
        return electricConfigService.queryElectricConfig(ElectricConfigTypeEnum.CELL_TYPE_CONFIG);
    }

    @ApiOperation(value = "查询电芯型号",notes = "@author Tony")
    @GetMapping("/api/electricConfig/queryElectricType")
    @NoValidPrivilege
    public ResponseDTO<List<ElectricTypeVO>> queryElectricType() {
        return electricConfigService.queryElectricConfig(ElectricConfigTypeEnum.ELECTRIC_CORE_TYPE_CONFIG);
    }

    @ApiOperation(value = "查询工厂配置",notes = "@author Tony")
    @GetMapping("/api/electricConfig/queryFactory")
    @NoValidPrivilege
    public ResponseDTO<List<ElectricTypeVO>> queryFactory() {
        return electricConfigService.queryElectricConfig(ElectricConfigTypeEnum.FACTORY_CONFIG);
    }
}
